// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from "vue";
import App from "@/App";
import router from "@/common/router";
import "@/common/router/permission";
import "@/assets/font/fonts.css";
import ElementUI from "element-ui";

/* ************* 引入系统公共模块 ************* */
import {
  config,
  store,
  global,
  utils,
  cacheKeys,
  log,
} from "@/common/app/index.js";
// 引入系统配置
Vue.prototype.$config = config;
// 缓存到storage中的keys
Vue.prototype.$cacheKeys = cacheKeys;
// 需全局定义的对象
Vue.prototype.$global = global;
// 日志打印工具类
Vue.prototype.$log = log;
// 应用utils工具类
Vue.prototype.$utils = utils;
/* ************* 引入系统公共模块 ************* */

// 引入系统自定义指令
import "@/common/app/directives";
// 系统所有公共样式及主题样式入口文件
import "@/common/style/index.scss";
// 系统所有公共样式及主题样式入口文件
import "@/business/style/index.scss";

// 使用easycom模块，将@/components/common目录下的app-开头的组件，全部加载为全局组件
import easycom from "@/common/service/easycom";
easycom.easyComponents("common", /^app-(.*).vue$/);

// import VueLazyLoad from 'vue-lazyload'
// Vue.use(VueLazyLoad, {
//   error: require('@/common/assets/images/default.png'),
//   loading: require('@/common/assets/images/default.png'),
//   preLoad: 1,
//   attempt: 1
// })
Vue.use(ElementUI, {
  i18n: (path, value) => utils.lang(path, value),
  size: "small",
});

/* eslint-disable no-new */
new Vue({
  el: "#app",
  router,
  store,
  components: { App },
  template: "<App/>",
});
